package org.darkforest.common.services;

import org.darkforest.model.Voucher;
import org.darkforest.model.VoucherSearchBean;
import org.darkforest.vo.MemberBase;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/1/5.
 */
public interface VoucherService {
    int deleteByPrimaryKey(Integer voucherId);

    int insert(Voucher record);

    int insertSelective(Voucher record);

    Voucher selectByPrimaryKey(Integer voucherId);

    int updateByPrimaryKeySelective(Voucher record);

    int updateByPrimaryKey(Voucher record);

    /**
     *
     * @param userId 用户ID
     * @param voucherState 是否可用
     * @param subtotal 商户内购买金额是否满足优惠券条件
     * @param goodsClass 是否符合商户限定的优惠商品类型
     * @param storeId  店铺ID
     * @return
     */
    List<Voucher> findMyValidVoucher(Integer userId, int voucherState, BigDecimal subtotal, String goodsClass, Integer storeId);


    String addCouponToUser(Integer voucherId,MemberBase member);

    List<Voucher> selectByCondition(VoucherSearchBean voucher);


}
